﻿/**
  *FileName:    patrick
  *Date:        23/5/3 周三 下午 6:01:48
  *Author:      Catherine
  *Version:     1.0
  *Description: 用easyx提供接口绘制的派大星！
*/

#include "example.h"

void PatrickStar() {
	initgraph(360, 480);	// 初始化图形窗口

	POINT left[] = { {103,250},{83,235},{63,192},{57,175}, {54,153}, {61,145}, {76,157} ,{112,182},{128,194},{136,200} };
	POINT right[] = { {215,220}, {243,195}, {272,169}, {301,156},{314,155},{319,164},{316,178},{302,203}, {278,236}, {238,277} };
	POINT head[] = { {228,206}, {219,165}, {217,132},{223,105}, {227,95}, {231,90}, {233,81}, {235,66}, {224,64}, {212,68},{189,85},{173,109},{163,136} };
	POINT eyel[] = { {174,148},{170,137},{151,134},{144,149}, {134,178}, {155,190}, {169,177} };
	POINT eyer[] = { {201,162},{200,138},{176,135},{168,162} ,{168,186}, {192,190}, {201,164} };
	POINT bodyl[] = { {146,181},{139,204},{123,232},{103,251},{85,286},{90,341},{132,363},{156,373},{165,375},{180,374}, };
	POINT bodyr[] = { {254,261},{263,272} ,{264,282} ,{262,292},{266,303} ,{260,328} ,{237,357} };
	POINT trou1[] = { {93,288},{124,326} ,{215,332} ,{261,294} };
	POINT trou2[] = { {93,299},{128,335} ,{228,332} ,{263,303} };
	POINT troul[] = { {106,344},{106,353} ,{104,359} ,{98,364}, {110,379} ,{131,383} ,{151,380},{152,378},{150,372},{148,369} };
	POINT trour[] = { {180,368},{181,371} ,{180,379} ,{179,384}, {193,390} ,{221,391} ,{238,381},{241,372},{238,361},{237,357} };
	POINT legl[] = { {107,374},{115,404},{135,401},{142,380} };
	POINT legr[] = { {191,388},{203,416},{222,413},{231,386} };
	POINT bellyu[] = { {137,296},{133,298},{137,305},{143,302} };
	POINT bellyd[] = { {132,301},{131,310},{143,313},{149,307} };
	POINT mouthud[] = { {145,200},{164,207},{192,201},{204,194} ,{187,232},{149,243},{135,226} };
	POINT mouthl[] = { {150,201},{154,211},{150,222},{139,229} };
	POINT mouthr[] = { {200,189},{202,191},{207,193},{211,195} };
	POINT balll[] = { {164,165},{165,159},{158,157},{157,163},  {156,169}, {162,169}, {164,165} };
	POINT ballr[] = { {187,165},{187,159},{179,158},{178,164}, {180,171}, {185,172}, {187,165} };
	POINT brow1[] = { {163,124},{169,125},{171,122},{175,122} };
	POINT brow2[] = { {164,129},{169,130},{173,129},{176,127} };
	POINT brow3[] = { {189,126},{194,126},{198,130},{201,133} };
	POINT brow4[] = { {187,129},{192,131},{195,133},{197,136} };
	POINT flower1[] = { {102,310},{100,324},{109,328},{110,324},{116,322},{120,326},{111,335},{111,342}, {119,348},{132,351},{139,350},{144,345}, {141,340},{141,337},{145,335},{149,342}, {154,347},{164,344},{166,328} };
	POINT flower2[] = { {249,340},{240,335},{232,338}, {227,345},{221,352},{220,355}, {230,360},{232,362},{230,370}, {223,364},{214,363},{211,377}, {215,388} };
	POINT tongue1[] = { {147,234},{150,227},{161,220},{172,221} };
	POINT tongue2[] = { {167,225},{175,218},{184,215},{185,221} };
	//POINT dot1[] = { {213,92},{208,92},{206,96},{208,99}, {211,97}, {213,96}, {213,92} };

	setbkcolor(RGB(254, 250, 205));
	cleardevice();

	setlinestyle(PS_SOLID, 3);
	setlinecolor(BLACK);
	Curve c;
	c.zpolybezier(left, 10);
	c.zpolybezier(right, 10);
	c.zpolybezier(head, 13);

	polybezier(eyel, 7);
	polybezier(eyer, 7);

	polybezier(bodyl, 10);
	polybezier(bodyr, 7);
	polybezier(trou1, 4);
	polybezier(trou2, 4);
	polybezier(troul, 10);
	polybezier(trour, 10);
	polybezier(legl, 4);
	polybezier(legr, 4);
	polybezier(bellyu, 4);
	polybezier(bellyd, 4);
	polybezier(mouthud, 7);
	polybezier(mouthl, 4);
	polybezier(mouthr, 4);
	polybezier(balll, 7);
	polybezier(ballr, 7);
	polybezier(brow1, 4);
	polybezier(brow2, 4);
	polybezier(brow3, 4);
	polybezier(brow4, 4);
	polybezier(flower1, 19);
	polybezier(flower2, 13);
	polybezier(tongue1, 4);
	polybezier(tongue2, 4);

	//setlinecolor(RED);
	//polybezier(dot1, 7);

	setfillcolor(RGB(187, 255, 108)); // 绿色裤子
	floodfill(184, 353, BLACK);
	floodfill(120, 367, BLACK);
	floodfill(254, 306, BLACK);
	setfillcolor(RGB(201, 182, 237));  // 紫色花
	floodfill(239, 342, BLACK);
	floodfill(127, 337, BLACK);
	setfillcolor(RGB(253, 173, 164));  // 肉粉色身体
	floodfill(215, 243, BLACK);
	floodfill(87, 200, BLACK);
	floodfill(126, 386, BLACK);
	floodfill(216, 401, BLACK);
	setfillcolor(RGB(124, 47, 27));  // 红色嘴巴
	floodfill(173, 214, BLACK);
	setfillcolor(RGB(224, 22, 20));
	floodfill(161, 231, BLACK);
	setfillcolor(RGB(2, 2, 2)); //眼睛 黑+白
	floodfill(182, 165, BLACK);
	floodfill(161, 165, BLACK);
	setfillcolor(RGB(244, 255, 255));
	floodfill(148, 169, BLACK);
	floodfill(187, 176, BLACK);

	_getch();				// 按任意键退出
	closegraph();
}